﻿using AutoMapper;
using Microsoft.Extensions.DependencyInjection;
using Newtonsoft.Json;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Workflow.Application.DTOs.Output;
using Workflow.Domain.Models;
using Workflow.Application.DTOs.Input;
using Workflow.Domain.Models;

namespace Workflow.Application.Extend
{
    public class AutoMapperExtend : Profile
    {
        public AutoMapperExtend()
        {
            // 配置WorkflowDefinitionModel到WorkflowDefinitionDto的映射
            CreateMap<WorkflowDefinitionModel, WorkflowDefinitionDto>();
            
            // 配置WorkflowGroupModel到WorkflowGroupDto的映射
            CreateMap<WorkflowGroupModel,WorkflowGroupDto>();
            CreateMap<WorkflowDefinitionModel, WorkflowDefinitionList>();
            CreateMap<WorkflowGroupModel,WorkflowGroupDto>();

            // 配置WorkflowInstanceModel到WorkflowInstanceDto的映射
            CreateMap<WorkflowInstanceModel, WorkflowInstanceDto>();
            
            // 配置AuditModel到AuditDto的映射
            CreateMap<AuditModel, AuditDto>();
            CreateMap<WorkflowDefinitionAddInput, WorkflowDefinitionModel>();
        }
    }
}
